const fenlei = document.querySelector('.contentul3')

const xhr = new XMLHttpRequest()
xhr.open('GET','/fenlei')
xhr.onload = function(){
  let str = ''
  let res = JSON.parse(xhr.responseText)
  res.products.forEach(function (item) {
    str += `<li>
    <img src="${item.coverUrl}" alt="">
    <p>${item.name}</p>
    <p class='p2'>￥${item.originalCost}</p>
  </li>
    `
  })
  fenlei.innerHTML = str
}
xhr.send()